Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: export elementUpdated #185

Closed
wants to merge 1 commit into from
Closed

fix: export elementUpdated #185

wants to merge 1 commit into from

Conversation

devpow112
Copy link
Contributor

@devpow112 devpow112 commented Sep 19, 2023

Was looking at switching outcomes over to this new framework and noticed that elementUpdated isn't exported from the @open-wc/testing package. Adding it so it's available unless there's a reason it was left out.

Source: https://github.com/open-wc/open-wc/blob/master/packages/testing-helpers/src/elementUpdated.js

Looks like it basically does what you describe here just covering more cases.

@devpow112 devpow112 marked this pull request as ready for review September 19, 2023 20:42
@devpow112 devpow112 requested a review from a team as a code owner September 19, 2023 20:42
@@ -1,5 +1,5 @@
import './vdiff.js';

export { assert, aTimeout, defineCE, expect, html, nextFrame, oneDefaultPreventedEvent, oneEvent, waitUntil } from '@open-wc/testing';
export { assert, aTimeout, defineCE, elementUpdated, expect, html, nextFrame, oneDefaultPreventedEvent, oneEvent, waitUntil } from '@open-wc/testing';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was mostly expecting folks to just use await elem.updateComplete in these cases... were you relying on the extra stuff they have in there? If we don't think it's needed, I can update the migration guide to just call this out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can take a look at not using it and see if I have any troubles. I was just doing my best to not change the tests if I didn't have to.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look tomorrow

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok let me know. I'm OK with adding it, but yeah it always struck me as odd to abstract it away when elem.updateComplete was right there. And then having it fall back to await nextFrame if the thing isn't a Lit element was just extra magic.

@devpow112
Copy link
Contributor Author

Worked fine without it. Not worth adding in that case.

@devpow112 devpow112 closed this Sep 19, 2023
@devpow112 devpow112 deleted the depowell/add branch September 19, 2023 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants